<html>
<head><meta charset="utf-8"><title>Test `library/std` with sanitizer enabled · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Test.20.60library.2Fstd.60.20with.20sanitizer.20enabled.html">Test `library/std` with sanitizer enabled</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="244950238"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Test%20%60library/std%60%20with%20sanitizer%20enabled/near/244950238" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dominik Stolz <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Test.20.60library.2Fstd.60.20with.20sanitizer.20enabled.html#244950238">(Jul 05 2021 at 15:39)</a>:</h4>
<p>Hi everyone,<br>
how would I run the standard library unit tests with a sanitizer?<br>
I tried <code>RUSTFLAGS="-Zsanitizer=address" ./x.py test library/std</code> but that fails with<br>
<code>error: the option </code>Z<code> is only accepted on the nightly compiler</code>.<br>
Any hints?</p>



<a name="244950428"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Test%20%60library/std%60%20with%20sanitizer%20enabled/near/244950428" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Test.20.60library.2Fstd.60.20with.20sanitizer.20enabled.html#244950428">(Jul 05 2021 at 15:41)</a>:</h4>
<p><span class="user-mention" data-user-id="302700">@Dominik Stolz</span> try RUSTFLAGS_BOOTSTRAP</p>



<a name="244950444"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Test%20%60library/std%60%20with%20sanitizer%20enabled/near/244950444" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Test.20.60library.2Fstd.60.20with.20sanitizer.20enabled.html#244950444">(Jul 05 2021 at 15:41)</a>:</h4>
<p>RUSTFLAGS also affects building bootstrap itself and things like that</p>



<a name="244950830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Test%20%60library/std%60%20with%20sanitizer%20enabled/near/244950830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dominik Stolz <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Test.20.60library.2Fstd.60.20with.20sanitizer.20enabled.html#244950830">(Jul 05 2021 at 15:45)</a>:</h4>
<p>Hmm, this does not work in my case since I want to use a custom sanitizer that is only available in the stage1 compiler.</p>



<a name="244950958"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Test%20%60library/std%60%20with%20sanitizer%20enabled/near/244950958" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Test.20.60library.2Fstd.60.20with.20sanitizer.20enabled.html#244950958">(Jul 05 2021 at 15:46)</a>:</h4>
<p>oh, RUSTFLAGS_NOT_BOOTSTRAP then</p>



<a name="244951476"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Test%20%60library/std%60%20with%20sanitizer%20enabled/near/244951476" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dominik Stolz <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Test.20.60library.2Fstd.60.20with.20sanitizer.20enabled.html#244951476">(Jul 05 2021 at 15:52)</a>:</h4>
<p>Seems to work. Thanks!</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>